<template>
	<view>
		<view style="padding-left: 43upx;padding-top: 22upx; text-align: center; background-color:#11CC99;height: 300upx;">
			<span style="font-size: 42upx;font-weight: 600;">污染物信息</span>
		</view>
		
		<view class="vmodul" style="margin-top: -180upx;">
			<view>
				<view class="cu-form-group" style="font-size: 46upx;font-weight: 550;">
					<span>污染物名称：</span>
					
					<input class="" v-model="pollInfo.pollName" type="text" placeholder="请输入" />
				</view>
				<view class="cu-form-group">
					<view class="reason">超标下限</view>
					<input class="" v-model="pollInfo.pollOverLower" type="text" placeholder="请输入" />
				</view>
				<view class="cu-form-group">
					<view class="reason">超标上限</view>
					<input class="" v-model="pollInfo.pollOverUpper" type="text" placeholder="请输入" />
				</view>
				<view class="cu-form-group">
					<view class="reason">预警下限</view>
					<input class="" v-model="pollInfo.pollAlarmLower" type="text" placeholder="请输入" />
				</view>
				<view class="cu-form-group">
					<view class="reason">预警上限</view>
					<input class="" v-model="pollInfo.pollAlarmUpper" type="text" placeholder="请输入" />
				</view>
			</view>
		</view>
		
		<view class="padding flex flex-direction">
			<button @click="passClick" class="cu-btn bg-grey lg">修改</button>
			<button @click="unPassClick" class="cu-btn bg-red margin-tb-sm lg">返回</button>
		</view>
	</view>
</template>

<script>
	import Util from '@/utils/util.js';
	export default{
		data(){
			return{
				pollInfo:{}
			}
		},
		components: {
		},
		onLoad(e) {
			
			//根据站点id查询站点信息
			if(e.id){
				//查询污染物
				Util.request('/monitor/EquipmentPollution/get', {id:e.id}, 'GET').then(res=>{
					
					this.pollInfo=res.data; 
				}).catch(()=>{
					//联网失败, 结束加载
				})
			}
		},
		mounted() {
		},
		methods:{
			passClick() {
				Util.request('/monitor/EquipmentPollution/update', this.pollInfo, 'POST').then(res=>{
					uni.showModal({
						title: '提示',
						content: '修改成功',
						showCancel: false,
						confirmText: '确定',
						success: res => {
							if (res.confirm) {
								uni.navigateBack({
									delta:1
								})
							}
						}
					})
				}).catch(()=>{
					//联网失败, 结束加载
				})
			},
			unPassClick() {
				uni.navigateBack({
					delta:1
				})
			}
		}
	}
</script>

<style>
	.vmodul{
		display: flex;
		flex-direction:column;
		margin-left: 22upx;
		margin-right: 22upx;
		margin-top: 22upx;
		background-color: #FCFCFC;
		padding: 10upx 10upx 10upx 10upx;
		border-radius:22upx
	}
	.reason{
		padding: .4rem .5rem;
	}
	.cuIcon-order::before{
		color: white;
		border-radius: 50%;
		background-color: #53C8E7;
		margin-right: 20upx;
	}
	.cuIcon-moneybagfill::before{
		color: #F2D67A;
		margin-right: 20upx;
	}
	.cuIcon-timefill::before{
		color: #8BB2F3;
		margin-right: 20upx;
	}
	.after-cuIcon-fold::after {
		content: "\e6de";
		color:#008800;
		font-weight: 200;
		font-size: 40upx;
	}
	.after-cuIcon-unfold::after {
		content: "\e661";
		color:#008800;
		font-weight: 200;
		font-size: 40upx;
	}
	.row{
		margin-left: 20upx;
		margin-right: 34upx;
		font-family: "cuIcon";
	}
	.img {
	  border-radius: 29.22rpx;
	  width: 200.65rpx;
	  height: 200.65rpx;
	  overflow: hidden;
	}
</style>
